package utils

import (
	"bytes"
	"encoding/binary"
)

type Number interface {
	~uint8 | ~uint16 | ~uint32 | ~uint64 | ~int | ~int32 | ~int64 | ~int8|~int16
}

func NumberToBytesWithBigEndian[T Number](t T) []byte {
	bytesBuffer := bytes.NewBuffer([]byte{})
	binary.Write(bytesBuffer, binary.BigEndian, t)
	return bytesBuffer.Bytes()
}
